import {
  createStore,
  applyMiddleware
} from 'redux'


import createSagaMiddleware from 'redux-saga'

import reducer from './reducer'

import sagas from './sagas'

import Immutable from 'immutable'

const initialState = Immutable.Map()

const sagaMiddleWare = createSagaMiddleware()

const store = createStore(
  reducer,
  initialState,
  applyMiddleware(sagaMiddleWare))

sagas.forEach(saga => sagaMiddleWare.run(saga))

export default store